package com.gfl.trivialrestclient.dao.hibernate;

import org.springframework.stereotype.Repository;

import com.gfl.trivialrestclient.dao.RoleDao;
import com.gfl.trivialrestclient.model.Role;

@Repository(value = "roleDao")
public class RoleDaoHibernate extends GenericDaoHibernate<Role, Long> implements
		RoleDao {

	@Override
	public Role findByRoleName(String roleName) {
		Role role = (Role) getSessionFactory().getCurrentSession()
				.getNamedQuery("Role.findByRoleName")
				.setString("roleName", roleName).uniqueResult();
		return role;
	}
}
